<table id="userList">
<thead>
<tr id="tr_0">
	<th colspan="2">用户列表</th>
	<td colspan="3">
		<select id="select_ug_id">
			<option value="">全部用户</option>
		{{ section name=i loop=$ugList }}
			<option id="s_{{ $ugList[i].user_group_id }}" value="{{ $ugList[i].user_group_id }}" ugname="{{ $ugList[i].group_name }}">{{ $ugList[i].levelstr }} {{ $ugList[i].group_name }}</option>
		{{ /section }}
		</select>
	</td>
	<td colspan="4"><a id="linkUserCreate" href="#">添加新用户</a></td>
</tr>
</thead>
<tr id="headline">
	<th></th>
	<th>用户名</th>
	<th>E-mail</th>
	<th>状态</th>
	<th>上次登录</th>
	<th colspan="4">操作</th>
</tr>
{{ section name=i loop=$userList }}
<tr id="tr_{{ $userList[i].member_id }}">
	<td><input type="checkbox" /></td>
	<td>{{ $userList[i].username }}</td>
	<td>{{ $userList[i].email }}</td>
	<td class="blocked">{{ $userList[i].is_blocked }}</td>
	<td class="login_at">{{ $userList[i].last_login_at }}</td>
	<td><a href="#" onclick="userUpdate( {{ $userList[i].member_id }}, '{{ $userList[i].username }}', '{{ $userList[i].email }}', '{{ $userList[i].user_group.user_group_id }}', '{{ $userList[i].user_group.group_name }}' );">修改</a></td>
	<td><a class="linkUserRemove" member_id="{{ $userList[i].member_id }}" href="#">删除</a></td>
	<td>
		<a class="block_switch" member_id="{{ $userList[i].member_id }}" href="#">{{ if $userList[i].is_blocked }}启用{{ else }}禁用{{ /if }}</a>
	</td>
	<td>
		<a href="?controller=admin_user&action=band&member_id={{ $userList[i].member_id }}">绑定</a>
	</td>
</tr>
{{ /section }}
<tfoot>
<tr>
	<td colspan="9">
		<a href="#" id="selectAll">全选</a> / 
		<a href="#" id="unselectAll">全部不选</a>
		<label>选定项：</label>
	</td>
</tr>
</tfoot>
</table>

<!-- 修改用户的表单/隐藏状态 -->
<div id="divUserCRUD" class='hideme'>

<form id="formUserUpdate" action="?controller=admin_user&action=userupdate" method="POST">
	<table>
		<tr>
			<th>ID:</th>
			<td>
				<input id='u_member_id' name='member_id' type='text' readonly='readonly' size='4' /> * 不可修改
			</td>
		</tr>
		<tr>
			<th>用户组:</th>
			<td><select id="u_select_user_group" name="user_group_id"></select></td>
		</tr>
		<tr>
			<th>用户名:</th>
			<td>
				<input id='u_username' name='username' type='text' size='20' class='required' 
				title='用户名不能为空' alt="{event: 'blur'}" maxlength="16"/>
			</td>
		</tr>
		<tr>
			<th>新密码:</th>
			<td>
				<input id='u_password' name='password' type='password' size='20' maxlength="16"/> * 不修改请留空
			</td>
		</tr>
		<tr>
			<th>Email:</th>
			<td>
				<input id='u_email' name='email' type='text' size='50' class='required email'
				title='请正确填写电子邮件' alt="{event: 'blur'}" maxlength="64" />
			</td>
		</tr>
		<tr>
			<th></th>
			<td>
				<input type='submit' value='修改' class='submitbutton' />
				<input type='button' value='取消' class='submitbutton' onclick='_removeModifyForm();' />
			</td>
		</tr>
	</table>
</form>

<form id="formUserCreate" action="?controller=admin_user&action=usercreate" method="POST">
	<table>
		<tr>
			<th><input id='c_user_group_id' name='user_group_id' type="hidden" value="" /></th>
			<td>在<span id='span_user_group_id'></span>中添加用户</td>
		</tr>
		<tr>
			<th>用户名:</th>
			<td>
				<input id='c_username' name='username' type='text' size='20' class='required' 
				title='用户名不能为空' alt="{event: 'blur'}" maxlength="16"/>
			</td>
		</tr>
		<tr>
			<th>密码:</th>
			<td>
				<input id='c_password' name='password' type='password' size='20' maxlength="16"/>
			</td>
		</tr>
		<tr>
			<th>Email:</th>
			<td>
				<input id='c_email' name='email' type='text' size='50' class='required email'
				title='请正确填写电子邮件' alt="{event: 'blur'}" maxlength="64" />
			</td>
		</tr>
		<tr>
			<th></th>
			<td>
				<input type='submit' value='创建新用户' class='submitbutton' />
				<input type='button' value='取消' class='submitbutton' onclick='_removeModifyForm();' />
			</td>
		</tr>
	</table>
</form>

</div>



